package com.yipei.business.service;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yipei.business.domain.MlPositionShare;
import com.yipei.business.domain.MlTradeDealOrder;
import com.yipei.business.domain.MlTradeEntrustOrder;
import com.yipei.common.core.domain.AjaxResult;
import com.yipei.common.core.domain.entity.MlTradeAccount;

/**
 * 成交订单Service接口
 *
 * @author yipei
 * @date 2024-12-21
 */
public interface IMlTradeDealOrderService extends IService<MlTradeDealOrder>
{
    /**
     * 查询成交订单
     *
     * @param id 成交订单主键
     * @return 成交订单
     */
    public MlTradeDealOrder selectMlTradeDealOrderById(Long id);

    /**
     * 查询成交订单列表
     *
     * @param mlTradeDealOrder 成交订单
     * @return 成交订单集合
     */
    public List<MlTradeDealOrder> selectMlTradeDealOrderList(MlTradeDealOrder mlTradeDealOrder);

    /**
     * 新增成交订单
     *
     * @param mlTradeDealOrder 成交订单
     * @return 结果
     */
    public int insertMlTradeDealOrder(MlTradeDealOrder mlTradeDealOrder);

    /**
     * 修改成交订单
     *
     * @param mlTradeDealOrder 成交订单
     * @return 结果
     */
    public int updateMlTradeDealOrder(MlTradeDealOrder mlTradeDealOrder);

    /**
     * 批量删除成交订单
     *
     * @param ids 需要删除的成交订单主键集合
     * @return 结果
     */
    public int deleteMlTradeDealOrderByIds(Long[] ids);

    /**
     * 删除成交订单信息
     *
     * @param id 成交订单主键
     * @return 结果
     */
    public int deleteMlTradeDealOrderById(Long id);

    AjaxResult createDealOrder(MlTradeEntrustOrder mlTradeEntrustOrder, BigDecimal cjJg, String cjSl, long cjSj,List<MlPositionShare> mlPositionShares,String status) throws Exception;


    String createDealDh();

    BigDecimal sellStock(List<MlPositionShare> mlPositionShares, MlTradeEntrustOrder mlTradeEntrustOrder, BigDecimal wtsl, BigDecimal wtJg, BigDecimal sxf,String status) throws Exception;

    void accountMessage(MlTradeEntrustOrder mlTradeEntrustOrder);

    BigDecimal countCommission(MlTradeAccount mlTradeAccount, String tdAcc, BigDecimal wtFx, String cjSl, BigDecimal cjJg);
}
